import 'package:flutter/material.dart';
import 'package:dustbin_sort/util/navigator_util.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

class InfoPage extends StatefulWidget
{
	@override
	State<StatefulWidget> createState()=>_InfoPageState();

}
class _InfoPageState extends State<InfoPage>
{

	final PageController _controller = PageController(
		initialPage: 3,
	);
	final List<Widget> _pages = <Widget>[
		Column(
			children: <Widget>[
				new Container(
					margin: EdgeInsets.all(7),
					child: Row(
						children: <Widget>[
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe63f
									child: Container(
										alignment: Alignment.center,
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe63f, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("纸盒"),flex: 1,),

											],
										),
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
										alignment: Alignment.center,
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe63c, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("洗衣机"),flex: 1,),

											],
										),
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
										alignment: Alignment.center,
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe611, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("啤酒瓶"),flex: 1,),
											],
										)

									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
										alignment: Alignment.center,
												child: Column(
													children: <Widget>[
													Expanded(child: Icon(IconData(0xe73f, fontFamily: 'IconFont')),flex: 1,),
													Expanded(child: Text("啤酒瓶"),flex: 1,),
													],
												)
									),
								),
							),
						],
					),
				),
				new Container(
					margin: EdgeInsets.all(7),
					child: Row(
						children: <Widget>[
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe6a6
									child: Container(
										child: Column(
											children: <Widget>[
											Expanded(child: Icon(IconData(0xe6a6, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("保鲜盒"),flex: 1,),
											],
										)
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe721
									child: Column(
											children: <Widget>[
											Expanded(child: Icon(IconData(0xe721, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("塑料瓶"),flex: 1,),
										],
									)
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe612
									child: Column(
										children: <Widget>[
											Expanded(child: Icon(IconData(0xe612, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("风车"),flex: 1,),
										],
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe605
									child: Column(
										children: <Widget>[
											Expanded(child: Icon(IconData(0xe605, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("玻璃"),flex: 1,),
										],
									),
								),
							),
						],
					),
				),
			],
		),
		Column(
			children: <Widget>[
				new Container(
					margin: EdgeInsets.all(7),
					child: Row(
						children: <Widget>[
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe63f
									child: Container(
										alignment: Alignment.center,
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe63f, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("纸盒"),flex: 1,),

											],
										),
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
										alignment: Alignment.center,
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe63c, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("洗衣机"),flex: 1,),

											],
										),
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
											alignment: Alignment.center,
											child: Column(
												children: <Widget>[
													Expanded(child: Icon(IconData(0xe611, fontFamily: 'IconFont')),flex: 1,),
													Expanded(child: Text("啤酒瓶"),flex: 1,),
												],
											)

									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									child: Container(
											alignment: Alignment.center,
											child: Column(
												children: <Widget>[
													Expanded(child: Icon(IconData(0xe73f, fontFamily: 'IconFont')),flex: 1,),
													Expanded(child: Text("啤酒瓶"),flex: 1,),
												],
											)
									),
								),
							),
						],
					),
				),
				new Container(
					margin: EdgeInsets.all(7),
					child: Row(
						children: <Widget>[
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe6a6
									child: Container(
											child: Column(
												children: <Widget>[
													Expanded(child: Icon(IconData(0xe6a6, fontFamily: 'IconFont')),flex: 1,),
													Expanded(child: Text("保鲜盒"),flex: 1,),
												],
											)
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
										height: 100,
										padding: EdgeInsets.all(7),
										//0xe721
										child: Column(
											children: <Widget>[
												Expanded(child: Icon(IconData(0xe721, fontFamily: 'IconFont')),flex: 1,),
												Expanded(child: Text("塑料瓶"),flex: 1,),
											],
										)
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe612
									child: Column(
										children: <Widget>[
											Expanded(child: Icon(IconData(0xe612, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("风车"),flex: 1,),
										],
									),
								),
							),
							Expanded(
								flex: 1,
								child: Container(
									height: 100,
									padding: EdgeInsets.all(7),
									//0xe605
									child: Column(
										children: <Widget>[
											Expanded(child: Icon(IconData(0xe605, fontFamily: 'IconFont')),flex: 1,),
											Expanded(child: Text("玻璃"),flex: 1,),
										],
									),
								),
							),
						],
					),
				),
			],
		),
	];
	@override
	Widget build(BuildContext context) {
		// TODO: implement build
		return Scaffold(
			appBar: AppBar(
				title: Text(
					"垃圾分类",
					style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,),
				),
				backgroundColor: Colors.white,
				centerTitle: false,
				elevation: 0,

			),
			body: Stack(
				children: <Widget>[
				MediaQuery.removePadding(
					removeTop: true,
					context: context,
					child: ListView(
						children: <Widget>[
							Container(
								margin: EdgeInsets.all(7),
								child: ClipRRect(
									borderRadius: BorderRadius.circular(9),
									child: new Image.asset(
										'assets/images/dustbin_sort_1.png',
										fit: BoxFit.cover,
									),
								),
							),
							Container(
								margin: EdgeInsets.all(7),
								padding: EdgeInsets.all(10),
								color: Colors.white,
								child: Center(
									child: Text("可回收物",style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
								),
							),
							Container(
								color: Colors.white,
								margin: EdgeInsets.all(7),
								padding: EdgeInsets.all(10),
								height: 250,
								child: Center(
									child: Swiper(

										itemBuilder: (BuildContext context, int index){
											return _pages[index];
										},
										itemCount: _pages.length,
										autoplay: false,
										loop: true,
										pagination: SwiperPagination(),
									),
								)
							),

							Container(
								padding: EdgeInsets.all(7),
								child: MaterialButton(
									padding: EdgeInsets.all(8),
									color: Colors.blue,
									textColor: Colors.white,
									child: new Text('马上回收'),
									onPressed: (){
										NavigatorUtil.push(context,
											WebviewScaffold(
												url: "https://www.baidu.com",
											)
										);
									},
								),
							)
						],
					),
				)
				]
			)
		);

	}

}